Given a positive integer N, the task is to construct an array a[] using first N natural numbers which contains no such triplet (i, j, k) satisfying a[k] * 2 = a[i] + a[j] and i < j < k....
Given a binary string S of length N. The task is to find the following:...
Given an array arr[] of N numbers. We can merge two adjacent numbers into one and the cost of merging the two numbers is equal to the sum of the two values. The task is to find the total minimum cost of merging all the numbers.Examples:...
Given binary string str, the task is to check whether the given string follows the below condition or not:...
Round 1 (Online Test):
Four Programming Questions-
a) Given a string find number of different substrings that are palindromes....
Round-1 Online Test
Online Test consists of 10 MCQ questions based on OS, DBMS, C and DS. Followed by a coding question which was similar to Kadane’s Algorithm with an extra condition that you can’t leave two consecutive entries. Five students were shortlisted after this round....
Given a binary string s, the task is to calculate the number of such substrings where the count of 1‘s is strictly greater than the count of 0‘s....
Given two integers x and n, write a function to compute xn. We may assume that x and n are small and overflow doesn’t happen....
Given two sorted arrays A[] and B[] consisting of N and M integers respectively, the task is to find the Kth smallest number in the array formed by the product of all possible pairs from array A[] and B[] respectively....
Given a number N and any base B. The task is to check if N can be expressed in the form a1*b0 + a2*b1 + a3*b2 + ….+ a101*b100 where each coefficients a1, a2, a3…a101 are either 0, 1 or -1....
Time complexity of Binary Search is O(log n), where n is the number of elements in the array. It divides the array in half at each step. Space complexity is O(1) as it uses a constant amount of extra space....
Given an integer X, find its square root. If X is not a perfect square, then return floor(√x)....